package pers.gxm.decorator;

public class StringDisplay extends Display{
    public static void main(String[] args) {
        String str1 = "hello,world";
//        str1 = "你好，世界";
        StringDisplay sd = new StringDisplay(str1);
//        sd.show();
        SideBorder sb = new SideBorder(sd, '*');
//        sb.show();
        FullBorder fb = new FullBorder(sd);
//        fb.show();
        FullBorder fb2 = new FullBorder(new SideBorder(new SideBorder(new FullBorder(sd), '%'), '^'));
//        fb2.show();

        UpDownBorder up = new UpDownBorder(sd, '@');
        UpDownBorder up2 = new UpDownBorder(up, '&');

//        up.show();
//        up2.show();
        FullBorder fb3 = new FullBorder(
                new UpDownBorder(
                        new SideBorder(
                                new UpDownBorder(
                                        new SideBorder(
                                                sd, '*'
                                        ),
                                        '='
                                ),
                                '|'
                        ),
                        '/')
        );
//        fb3.show();
        String s1 = "gxmjdk8";
        String s2 = "bin\\java.exe";
        String s3 = "16:12 Thur 2023/9/7";
        MultiString ms = new MultiString();
        ms.add(s1);
        ms.add(s2);
        ms.add(s3);
        ms.show();
        FullBorder fullBorder = new FullBorder(ms);
        fullBorder.show();



    }
    private String str;
    public StringDisplay(String str){
        this.str = str;
    }

    @Override
    public int getColumns() {
        return str.getBytes().length;
    }

    @Override
    public int getRows() {
        return 1;
    }

    @Override
    public String getRowText(int row) {
        if(row != 0)
        return null;
        return str;
    }
}
